home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / Exitstat.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-16  |  604 b   |  35 lines

  1. /* Copyright (C) 1986-2001 by Digital Mars. $Revision: 1.1.1.1 $ */
  2. #if __SC__ || __RCC__
  3. #pragma once
  4. #endif
  5.  
  6. #ifndef __EXITSTAT_H
  7. #define __EXITSTAT_H 1
  8.  
  9. #ifdef __cplusplus
  10. extern "C"
  11.   {
  12. #endif
  13.  
  14. #include <setjmp.h>
  15.  
  16. #ifndef __STDC__
  17. int __cdecl exit_PUSHSTATE(void);
  18. int __cdecl exit_popstate(void);
  19. #else
  20. int exit_PUSHSTATE(void);
  21. int exit_popstate(void);
  22. #endif
  23.  
  24. extern jmp_buf _exit_state;
  25.  
  26. #define exit_pushstate(RESULT) \
  27. ((exit_PUSHSTATE()!=0)?RESULT=2:\
  28. (((RESULT=setjmp(_exit_state))!=0)?exit_popstate(),RESULT:RESULT))
  29.  
  30. #ifdef __cplusplus
  31.   }
  32. #endif
  33.  
  34. #endif
  35.